package redisKey

import (
	"fmt"
	"strings"
)

// key
const PlayerPrefix = "Player_"

// Field
const (
	// SocketServerIP
	Player_SocketServerAddress = "SocketServerAddress"

	// 玩家状态
	Player_Status = "Status"

	// 玩家名称
	Player_Name = "Name"

	// 玩家等级
	Player_Lv = "Lv"

	// 玩家Vip
	Player_Vip = "Vip"

	// 玩家战力
	Player_FAP = "FAP"

	// 玩家历史最高战力
	Player_MaxFap = "MaxFap"

	// 服务器组Id
	Player_ServerGroupId = "ServerGroupId"

	// 合作商Id
	Player_PartnerId = "PartnerId"

	// 服务器Id(SocketServer/玩家所在的服务器Id)
	Player_ServerId = "ServerId"

	// 服务器名称
	Player_Zone = "Zone"

	// 头像Id
	Player_HeadImageId = "HeadImageId"

	// 时装模型Id
	Player_FashionModelId = "FashionModelId"

	// 头像框
	Player_PVPInterLv = "PVPInterLv"

	// 公会名称
	Player_GuildName = "GuildName"

	// 聊天服务器地址
	Player_ChatServerUrl = "ChatServerUrl"

	// 出战宠物
	Player_CombatPet = "CombatPet"

	// 战斗信息
	Player_FightInfo = "FightInfo"

	// 阵容
	Player_Formation = "Formation"

	// 英雄头像展示
	Player_BaseFormation = "BaseFormation"

	// 卡槽信息
	Player_SlotFormationInfo = "SlotFormationInfo"

	// 法宝Id
	Player_MountModelId = "MountModelId"

	// 法宝等级
	Player_MountLv = "MountLv"

	//玩家当前所在模块
	Player_CurModuleType = "CurModuleType"

	// 头像框Id
	Player_DiyHeadPortraitId = "DiyHeadPortraitId"

	// 荣誉点加成倍数
	Player_GloryMultiple = "GloryMultiple"
)

// 获取玩家的rediskey
func GetPlayerKey(playerId string) string {
	return fmt.Sprintf("%s%s", PlayerPrefix, playerId)
}

// 获取playerid
func GetPlayerId(playerKey string) string {
	return strings.TrimPrefix(playerKey, PlayerPrefix)
}
